def main():

    y_or_n = input("是否退出程序（y/n）？：")

    while y_or_n == "n":
        gender = input("性别")
        weight = float(input("体重(kg)"))
        height = float(input("身高(cm)"))
        age = float(input("年龄"))

        if gender == "男":
            bmr = 13.7 * weight + 5.0 * height - 6.8 * age + 66
        elif gender == "女":
            bmr = 9.6 * weight + 1.8 * height - 4.7 * age + 655
        else:
            bmr = 0

        if bmr != 0:
            print("基础代谢率(bmr):", bmr)
        else:
            print("性别填写有误")

        print("感谢您的支持")
        print()
        y_or_n = input("是否退出程序(y/n)")

if __name__ == '__main__':
    main()








